export function strLenFilter(str, len = 8) {
  if (str.length > len) {
    return str.substring(0, len) + "...";
  } else {
    return str;
  }
}

let i = function (t) {
  return t > 9 ? t : "0" + t
};
export function formatDate(t, e = ":", c = "-") {
  if (("number" == typeof t || "string" == typeof t) && (t = new Date(t))) {
    return [[t.getFullYear(), i(t.getMonth() + 1), i(t.getDate())].join(e), [t.getHours(), t.getMinutes(), t.getSeconds()].join(e)]
      .join(c);
  } else {
    return t;
  }
}